#!/bin/sh
TIME=`date -d "-1 day" "+%Y-%m-%d"`
#TIME=`date +%Y-%m-%d`
cd /root/backup/log
#wget -c -t 0  http://118.139.181.116:81/log/faithwar.log.$TIME
wget -c -t 0  http://118.139.181.116:81/log/faithwar.log.$TIME.tar.gz
tar zxvf faithwar.log.$TIME.tar.gz
#sleep 20s
#sed -i -e '/whatday/!d' faithwar.log.$TIME
sleep 15s
more /root/backup/log/faithwar.log.$TIME|cut -b22- >/root/backup/log/faithwar/$TIME
sleep 10s
cd /root/backup/log/faithwar/
split -l 20000 $TIME $TIME
sleep 10s
cp /root/backup/log/faithwar/$TIME'aa' /usr/share/nginx/www/log/faithwar/log.txt
#cp /root/backup/log/faithwar/$TIME'ab' /usr/share/nginx/www/log/faithwar/logb
sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/truncate.php
sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/faithwar.php

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/del.php

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/filter.php

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/update_firstlogin.php

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/update_time.

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/filter_tbheartbeat_last.php

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/update_tbheartbeat_tc.php

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/update_tbheartbeat_last_temp_totemp.php

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/tbiap.php

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/money.php

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/update_tc.php

#sleep 10s
rm -rf  /root/backup/log/faithwar/$TIME*

sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/insert.php
#sleep 10s
#php -q /usr/share/nginx/www/log/faithwar/trunk/update.php
sleep 10s
php -q /usr/share/nginx/www/log/faithwar/trunk/report_nojailbreak.php
#sleep 10s
#php -q /usr/share/nginx/www/log/faithwar/trunk/report.php
#sleep 10s
#php -q /usr/share/nginx/www/log/faithwar/trunk/report_week_nojailbreak.php

